#include "restrictionlayout.hpp"

#include <QLineEdit>
#include <QIntValidator>
#include <QCalendarWidget>
#include <QMessageBox>

RestrictionLayout::RestrictionLayout(int type):QHBoxLayout(),type(type){
	this->qpbrm=new QPushButton("Remove");
	connect(this->qpbrm,SIGNAL(clicked()),this,SLOT(rmClick()));
	switch(type){
		case 0:{
			qlname=new QLabel(QString::fromUtf8("Data de modificação anterior a"));
			break;
		}
		case 1:{
			qlname=new QLabel(QString::fromUtf8("Data de modificação posterior a"));
			break;
		}
		case 2:{
			qlname=new QLabel("Tamanho maior que");
			break;
		}
		case 3:{
			qlname=new QLabel("Tamanho menor que");
			break;
		}
	}
}

RestrictionLayout::~RestrictionLayout(){
	delete qlname;
	delete qpbrm;
}

void RestrictionLayout::rmClick(){
	emit remove(this->type);
}

int RestrictionLayout::getType(){
	return this->type;
}

QString RestrictionLayout::getName(){
	return qlname->text();
}

QPushButton *RestrictionLayout::getRmButton(){
	return this->qpbrm;
}
